package me.boot.sys.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.boot.common.data.enums.Gender;
import me.boot.common.data.model.Contacts;
import me.boot.db.mybatis.handler.BaseEnumTypeHandler;
import me.boot.db.mybatis.template.entity.AutoEntity;
import me.boot.gen.table.annotation.ColumnComment;
import me.boot.gen.table.annotation.Unique;

@Getter
@Setter
@ApiModel("用户表")
@TableName(autoResultMap = true)
public class SysUser extends AutoEntity {

    @Unique
    @ColumnComment("登录用户名")
    @ApiModelProperty(value = "登录用户名")
    @TableField
    private String username;

    @ColumnComment("密码")
    @ApiModelProperty(value = "密码")
    @TableField
    private String password;

    @ColumnComment("昵称")
    @ApiModelProperty(value = "昵称")
    @TableField
    private String nickname;

    @ColumnComment("真实姓名")
    @ApiModelProperty(value = "真实姓名")
    @TableField
    private String realname;

    @ColumnComment("性别")
    @ApiModelProperty(value = "性别")
    @TableField(typeHandler = BaseEnumTypeHandler.class)
    private Gender gender;

    @ColumnComment("头像")
    @ApiModelProperty(value = "头像")
    @TableField
    private String avatar;

    @ColumnComment("账号未过期")
    @ApiModelProperty(value = "账号未过期")
    @TableField
    private boolean accountNonExpired = true;

    @ColumnComment("账号未锁定")
    @ApiModelProperty(value = "账号未锁定")
    @TableField
    private boolean accountNonLocked = true;

    @ColumnComment("证书未过期")
    @ApiModelProperty(value = "证书未过期")
    @TableField
    private boolean credentialsNonExpired = true;

    @ColumnComment("联系方式")
    @ApiModelProperty(value = "联系方式")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Contacts contacts;

}
